Skip to content

feat(github-app): check-run annotation builder - #608

Merged
JSONbored merged 3 commits into
JSONbored:mainfrom
kiannidev:feat/issue-574-check-run-annotation-builder
Jun 12, 2026
Merged

feat(github-app): check-run annotation builder#608
JSONbored merged 3 commits into
JSONbored:mainfrom
kiannidev:feat/issue-574-check-run-annotation-builder

Conversation

@kiannidev

@kiannidev kiannidev commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds buildCheckRunAnnotations in src/rules/advisory.ts to map duplicate overlap, missing-test hotspots, and public advisory findings onto GitHub check-run annotation payloads.
  • Maps advisory severity to annotation levels (notice / warning / failure), sanitizes all messages via sanitizeForCheckRun, and caps inline output at 50 annotations with an omitted-count rollup in formatCheckRunOutput.
  • Adds unit coverage in test/unit/rules.test.ts for hotspot mapping, deduplication, severity levels, cap behavior, and public/private output boundaries (forbidden-term assertions).

Closes #574

Scope

  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; global coverage stays at or above 97% for lines, statements, functions, and branches (aim for 98%+ branch coverage locally so CI variance does not fail near the threshold)
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm run audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • npm run validate was run locally (covers typecheck + test:coverage); branch coverage met the 97% threshold.
  • Remaining CI checks (actionlint, test:workers, build:mcp, test:mcp-pack, ui:*, audit) are left for CI to run.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (not applicable — builder/render layer only)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (no public API/OpenAPI/MCP surface change; builder is internal)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (not applicable — backend only)
  • Visible UI changes include screenshots or a short recording. (not applicable — no UI changes)
  • Public docs/changelogs are updated where needed. (not applicable)

Notes

Map duplicate overlap, missing-test hotspots, and public advisory findings
to sanitized GitHub check-run annotations with severity mapping and a 50-cap
rollup for inline hotspot output.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ghost

ghost commented Jun 11, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #608 is no longer open. No action.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 11, 2026
@ghost

ghost commented Jun 11, 2026

Copy link
Copy Markdown

reviewbot · advisory review

Reviewed 2 changed file(s) — two independent AI reviewers.

Suggested action:Safe to merge — the reviewer found no blocking issues.

Reviewer A · gpt-oss-120b — recommends ✅ merge
The PR adds a comprehensive check‑run annotation builder, extending advisory formatting to include inline annotations and handling limits. It introduces new types, constants, helper functions, and updates the output API, with extensive unit tests covering core scenarios.

Suggestions

  • Consider simplifying annotationLineForFile – the current ternary always returns 1.
  • Document the new annotationContext parameter in the function JSDoc for future maintainers.
  • Verify that the imported CollisionCluster and CollisionReport types are exported from ../signals/engine.

Worth double-checking

  • Existing callers must handle the optional annotations field; ensure no runtime assumptions break.
  • The regex in isCodePath includes markdown files; confirm this aligns with intended hotspot detection.

Reviewer B · nemotron-3-120b-a12breview unavailable

@dosubot dosubot Bot added the size:L label Jun 11, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@ghost

ghost commented Jun 12, 2026

Copy link
Copy Markdown

gittensory · advisory review

Reviewed 2 changed file(s) — two independent AI reviewers.

Suggested action:Safe to merge — both reviewers found no blocking issues.

Reviewer A · gpt-oss-120b — recommends ✅ merge
The PR adds a comprehensive check‑run annotation builder, extending advisory output with structured annotations and thorough unit tests. The implementation is clean, respects the existing API, and the new functionality is well‑covered by tests.

Suggestions

  • Consider adding a comment clarifying that annotationLineForFile currently always returns line 1, in case future logic is needed.
  • Document the new optional annotationContext parameter in the function’s JSDoc to aid future developers.
  • Verify that any barrel (index.ts) files re‑export the new types/constants if they are used outside this module.

Worth double-checking

  • Existing callers of formatCheckRunOutput now receive an extended return type; ensure no code relies on exact shape without allowing extra fields.
  • The added CollisionCluster import is only used for typing; ensure the type is exported from ../signals/engine to avoid TypeScript errors.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
This PR adds GitHub Check Run annotation generation to advisory results, enabling inline annotations for missing tests, duplicate overlaps, and public findings. The implementation is thorough with comprehensive unit tests covering edge cases, deduplication, annotation limits, and detail levels. Changes are localized to advisory.ts and its test file, maintaining backward compatibility.

Suggestions

  • Consider improving annotationLineForFile to reference a more meaningful line (e.g., first changed line) rather than always returning line 1 for better annotation usefulness.
  • Evaluate whether collision annotations should be limited to files actually involved in the overlap (if such data is available) to reduce noise, though current PR-level approach is acceptable.

Worth double-checking

  • The annotationLineForFile function always returns line 1, which may reduce annotation usefulness if not improved in future work.
  • Ensure that the added import types (PullRequestFileRecord, CollisionReport) exist and are correctly referenced to avoid build/runtime errors.
  • Verify that the sanitizeForCheckRun function adequately handles GitHub's annotation limits (though tests cover length truncation).

@ghost ghost added the gittensory-review label Jun 12, 2026
@dosubot dosubot Bot added the lgtm label Jun 12, 2026
@JSONbored
JSONbored merged commit c7b899e into JSONbored:main Jun 12, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 12, 2026
@JSONbored JSONbored added the gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. label Jun 12, 2026
kiannidev added a commit to kiannidev/gittensory that referenced this pull request Jun 12, 2026
Reconcile rules.test.ts with the merged annotation builder from JSONbored#608 so
this PR keeps only Context check wiring changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

feat(github-app): check-run annotation builder

2 participants